using System.ComponentModel.DataAnnotations.Schema;
using UniversalAdmin.Shared.Enums;
using Microsoft.AspNetCore.Identity;
namespace UniversalAdmin.Domain.Entities;

//用户实体类
public class User : IdentityUser<Guid>
{

    public string Username { get; set; } = string.Empty; //string.Empyt 表示返回一个空字符串
    
    public string PasswordSalt { get; set; } = string.Empty; // 密码盐
    public string? Avatar { get; set; } // 头像
    public string? Bio { get; set; } // 个人简介
    public UserStatus Status { get; set; } = UserStatus.Active; //枚举类型的用户状态开关
    public DateTime LastLoginAt { get; set; } = DateTime.UtcNow; //最后登录时间

    [Column("login_attempts")]
    public int LoginAttempts { get; set; } = 0; // 登录尝试次数

    // 用户角色导航属性
    public virtual ICollection<Role> Roles { get; set; } = new List<Role>();

}


